/*************************************************************************
	> File Name: P5602.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-10 15:58:38
 ************************************************************************/
#include <iostream>
#include <algorithm>
using namespace std;

#define MAX_N 300000

int arr[MAX_N + 5];

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    sort(arr, arr + n, greater<int>());
    double ans = 0, sum = 0, cnt = 0;
    for (int i = 0; i < n; i++) {
        sum += arr[i];
        cnt += 1;
        if (sum / cnt * sum >= ans) ans = sum / cnt * sum;
        else break;
    }
    printf("%.8lf\n", ans);
    return 0;
}
